﻿using System.Linq;
using System.Threading.Tasks;
using cfg.card;
using cfg.character;
using cfg.pawn;
using kemocard.Scripts.Module.Battle;
using kemocard.Scripts.Pawn;

namespace kemocard.Scripts.Buff;

public class B1 : BaseBuff
{
    public B1()
    {
        Id = "1";
        Name = "冷气凝集";
        Description = "自身/3回合/物理攻击提高7500";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 7500;
    }
}

public class B6 : BaseBuff
{
    public B6()
    {
        Id = "6";
        Name = "疾走型地鼠";
        Description = "己方/全体/2回合/物理防御增加3000,抽卡+1";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddDraw += 1;
    }
}

public class B7 : BaseBuff
{
    public B7()
    {
        Id = "7";
        Name = "疾走型地鼠";
        Description = "敌方/单体/2回合/物理攻击降低2000,物理防御降低2000";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense -= 2000;
        inStruct.AddPAttack -= 2000;
    }
}

public class B9 : BaseBuff
{
    public B9()
    {
        Id = "9";
        Name = "灵舞";
        Description = "3回合/物理攻击提高6000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 6000;
    }
}

public class B10 : BaseBuff
{
    public B10()
    {
        Id = "10";
        Name = "天轮";
        Description = "2回合/回复量提高2000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHeal);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHeal += 2000;
    }
}

public class B13 : BaseBuff
{
    public B13()
    {
        Id = "13";
        Name = "对阵战线";
        Description = "自身/3回合/嘲讽:2，生命上限提高15000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        IsUnique = false;
        Tags.Add(BuffTag.Taunt);
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 15000;
        inStruct.Taunt += 2;
    }
}

public class B14 : BaseBuff
{
    public B14()
    {
        Id = "14";
        Name = "魔力拒止";
        Description = "己方/全体/3回合/魔法防御提高2000,抽卡+1";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 2000;
        inStruct.AddDraw += 1;
    }
}

public class B15 : BaseBuff
{
    public B15()
    {
        Id = "15";
        Name = "强化武装";
        Description = "己方/全体/3回合/物理防御提高2000+20%当前自身的生命上限";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void AfterSettingOwner()
    {
        TempValue = (Owner?.MaxHealth ?? 0) * 0.2f;
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 2000 + TempValue;
    }
}

public class B17 : BaseBuff
{
    public B17()
    {
        Id = "17";
        Name = "无力化";
        Description = "敌方/单体/2回合/物理攻击降低5000，每1连携增加500妨害量";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense -= 5000 + TempValue;
    }
}

public class B19E : BaseBuff
{
    public B19E()
    {
        Id = "19E";
        Name = "吸收";
        Description = "敌方/全体/3回合/魔法攻击降低2000,己方全体魔法攻击提升5000(固定)";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 2000;
    }
}

public class B19T : BaseBuff
{
    public B19T()
    {
        Id = "19E";
        Name = "吸收";
        Description = "敌方/全体/3回合/魔法攻击降低2000,己方全体魔法攻击提升5000(固定)";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 5000;
    }
}

public class B21 : BaseBuff
{
    public B21()
    {
        Id = "21";
        Name = "";
        Description = "2回合/物理防御提升";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 2000 + TempValue;
    }
}

public class B22 : BaseBuff
{
    public B22()
    {
        Id = "22";
        Name = "";
        Description = "己方/全体/2回合/魔法防御提高1000,抽卡+2";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 1000;
        inStruct.AddDraw += 2;
    }
}

public class B23 : BaseBuff
{
    public B23()
    {
        Id = "23";
        Name = "";
        Description = "己方/全体/3回合/全防御提高4000，抽卡+1";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 4000;
        inStruct.AddMDefense += 4000;
        inStruct.AddDraw += 2;
    }
}

public class B24 : BaseBuff
{
    public B24()
    {
        Id = "24";
        Name = "";
        Description = "己方/全体/2回合/物理防御提高3000,自身防御2张以上，变为全防御";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        if (SpecialFlag) inStruct.AddMDefense += 3000;
    }
}

public class B25 : BaseBuff
{
    public B25()
    {
        Id = "25";
        Name = "";
        Description = "自身/2回合/物理攻击提高25000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 25000;
    }
}

public class B29 : BaseBuff
{
    public B29()
    {
        Id = "29";
        Name = "";
        Description = "己方/全体/2回合/物理伤害提高4000+10%当前生命";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 4000 + TempValue;
    }

    public override void AfterSettingOwner()
    {
        Description = $"己方/全体/2回合/物理伤害提高{4000 + TempValue}";
    }
}

public class B30 : BaseBuff
{
    public B30()
    {
        Id = "30";
        Name = "";
        Description = "己方/全体/2回合/魔法伤害提高25000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 25000;
    }
}

public class B34 : BaseBuff
{
    public B34()
    {
        Id = "34";
        Name = "";
        Description = "敌方/全体/2回合/全攻击降低3000,2连携以上、受到的水属性伤害+25%";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.Attacked);
        Tags.Add(BuffTag.BeWaterUp);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 3000;
        inStruct.AddPAttack -= 3000;
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        if (data is not Damage damage || tag != BuffTag.Attacked || (damage.Attribute & (int)Attribute.WATER) == 0)
            return Task.CompletedTask;
        if (!damage.Modifiers.TryAdd(DamageModifier.DamageScale, 1.25f))
        {
            damage.Modifiers[DamageModifier.DamageScale] += 0.25f;
        }

        return Task.CompletedTask;
    }
}

public class B35 : BaseBuff
{
    public B35()
    {
        Id = "35";
        Name = "";
        Description = "敌方/单体/3回合/物理攻击降低5000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 5000;
    }
}

public class B36 : BaseBuff
{
    public B36()
    {
        Id = "36";
        Name = "";
        Description = "敌方/全体/3回合/魔法攻击降低10000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 10000;
    }
}

public class B37 : BaseBuff
{
    public B37()
    {
        Id = "37";
        Name = "";
        Description = "己方/全体/2回合/物理防御提高3000+10%当前生命值,抽卡+1";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000 + TempValue;
        inStruct.AddDraw += 1;
    }
}

public class B38 : BaseBuff
{
    public B38()
    {
        Id = "38";
        Name = "";
        Description = "自身/3回合/嘲讽:2，生命上限提高15000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.Taunt);
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 15000;
        inStruct.Taunt += 2;
    }
}

public class B39 : BaseBuff
{
    public B39()
    {
        Id = "39";
        Name = "";
        Description = "己方/全体/2回合/生命上限提高6000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 6000;
    }
}

public class B40 : BaseBuff
{
    public B40()
    {
        Id = "40";
        Name = "";
        Description = "自身/2回合/全防御提高5000点";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 5000;
        inStruct.AddMDefense += 5000;
    }
}

public class B44 : BaseBuff
{
    public B44()
    {
        Id = "44";
        Name = "";
        Description = "自身/2回合/物理攻击提高1000+1%生命上限，每1连携提高1%加成";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 1000 + TempValue;
    }
}

public class B45 : BaseBuff
{
    public B45()
    {
        Id = "45";
        Name = "";
        Description = "敌方/全体/2回合/物理攻击降低3000点，卡组暗属性6以上、物理防御降低3000点";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 3000;
        if (SpecialFlag) inStruct.AddPDefense -= 3000;
    }
}

public class B46 : BaseBuff
{
    public B46()
    {
        Id = "46";
        Name = "";
        Description = "敌方/全体/2回合/魔法攻击降低3000点，卡组暗属性6以上、魔法防御降低3000点";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 3000;
        if (SpecialFlag) inStruct.AddMDefense -= 3000;
    }
}

public class B47 : BaseBuff
{
    public B47()
    {
        Id = "47";
        Name = "";
        Description = "物理攻击3回合降低2000点";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 2000;
    }
}

public class B48 : BaseBuff
{
    public B48()
    {
        Id = "48";
        Name = "";
        Description = "魔法攻击3回合降低2000点";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 2000;
    }
}

public class B49 : BaseBuff
{
    public B49()
    {
        Id = "49";
        Name = "";
        Description = "己方/单体/1回合/全攻击提高15000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 15000;
        inStruct.AddMAttack += 15000;
    }
}

public class B51 : BaseBuff
{
    public B51()
    {
        Id = "51";
        Name = "";
        Description = "己方/单体/3回合/生命上限提升10000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 10000;
    }
}

public class B52 : BaseBuff
{
    public B52()
    {
        Id = "52";
        Name = "";
        Description = "自身/2回合/回复量提高5000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHeal);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHeal += 5000;
    }
}

public class BatEarthGuard : BaseBuff
{
    public BatEarthGuard()
    {
        Id = "BAT_EARTH_GUARD";
        Name = "狂乱型血蝠";
        Description = "自身/3回合/伤害减免+20%,抽卡+2,不可叠加";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        IsUnique = false;
        Tags.Add(BuffTag.Reduction);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.Reduction -= 0.2f;
        inStruct.AddDraw += 2;
    }
}

public class BatEarthBlocker : BaseBuff
{
    public BatEarthBlocker()
    {
        Id = "BAT_EARTH_BLOCKER";
        Name = "狂乱型血蝠";
        Description = "敌方/单体/3回合/物理攻击降低7500";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 7500;
    }
}

public class BatEarthSupport : BaseBuff
{
    public BatEarthSupport()
    {
        Id = "BAT_EARTH_SUPPORT";
        Name = "狂乱型血蝠";
        Description = "己方/全体/3回合/物理伤害提高15000点，伤害减免-30%";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.Reduction);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 15000;
        inStruct.Reduction += 0.3f;
    }
}

public class AcidWormAttacker : BaseBuff
{
    public AcidWormAttacker()
    {
        Id = "ACID_WORM_ATTACKER";
        Name = "强酸型蠕虫";
        Description = "3回合魔法防御降低5000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense -= 5000;
    }
}

public class AcidWormDefenderE : BaseBuff
{
    public AcidWormDefenderE()
    {
        Id = "ACID_WORM_DEFENDER_E";
        Name = "强酸型蠕虫";
        Description = "敌方/全体/3回合/魔法防御降低10000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense -= 10000;
    }
}

public class AcidWormDefenderT : BaseBuff
{
    public AcidWormDefenderT()
    {
        Id = "ACID_WORM_DEFENDER_T";
        Name = "强酸型蠕虫";
        Description = "己方3回合魔法防御提高3000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 3000;
    }
}

public class AcidWormBlockerE : BaseBuff
{
    public AcidWormBlockerE()
    {
        Id = "ACID_WORM_BLOCKER_E";
        Name = "强酸型蠕虫";
        Description = "敌方/全体/3回合/魔法防御降低15000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense -= 15000;
    }
}

public class AcidWormBlockerT : BaseBuff
{
    public AcidWormBlockerT()
    {
        Id = "ACID_WORM_BLOCKER_T";
        Name = "强酸型蠕虫";
        Description = "自身3回合魔法攻击提高5000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 5000;
    }
}

public class RoverTyphoonSupport : BaseBuff
{
    public RoverTyphoonSupport()
    {
        Id = "ROVER_TYPHOON_SUPPORT";
        Name = "漂泊型泰夫";
        Description = "己方/全体/2回合/物理伤害提高10000点，4连携以上、提高量提升50%";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += SpecialFlag ? 15000 : 10000;
    }
}

public class RoverTyphoonGuard : BaseBuff
{
    public RoverTyphoonGuard()
    {
        Id = "ROVER_TYPHOON_GUARD";
        Name = "漂泊型泰夫";
        Description = "己方/全体/3回合/全防御提高3000，抽卡+2";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddMDefense += 3000;
        inStruct.AddDraw += 2;
    }
}

public class RoverTyphoonBlocker : BaseBuff
{
    public RoverTyphoonBlocker()
    {
        Id = "ROVER_TYPHOON_BLOCKER";
        Name = "漂泊型泰夫";
        Description = "敌方/单体/2回合/全伤害降低2000,3连携以上、目标改为敌全体";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 2000;
        inStruct.AddMAttack -= 2000;
    }
}

public class SnStarGuard : BaseBuff
{
    public SnStarGuard()
    {
        Id = "SN_STAR_GUARD";
        Name = "夏夜型星";
        Description = "己方/全体/3回合/全防御提高3000，抽卡+2";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddMDefense += 3000;
        inStruct.AddDraw += 2;
    }
}

public class SnStarSupport : BaseBuff
{
    public SnStarSupport()
    {
        Id = "SN_STAR_SUPPORT";
        Name = "夏夜型星";
        Description = "自身/3回合/回复量提升1000，每回合开始时、己方全体回复1点生命";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        if (tag != BuffTag.TurnStart) return Task.CompletedTask;
        var healer = Mod?.Teammates.Find(c => c.Role == Role.SUPPORT && !c.IsDead);
        var value = 1 + (healer?.Heal ?? 0);
        HealStruct heal = new()
        {
            Value = value,
            Role = Causer.Role,
            Attribute = (int)Attribute.LIGHT,
            Target = Mod?.Teammates.ToList<BasePawn>(),
            User = Causer,
        };
        return Mod?.DoHeal(heal);
    }
}

public class FesZellerGuard : BaseBuff
{
    public FesZellerGuard()
    {
        Id = "FES_ZELLER_GUARD";
        Name = "庆典型蔡勒";
        Description = "己方/全体/2回合/物理防御提高2000,抽卡+1,自身防御2张以上、威力提高100%";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += SpecialFlag ? 4000 : 2000;
        inStruct.AddDraw += 1;
    }
}

public class FesZellerBlocker : BaseBuff
{
    public FesZellerBlocker()
    {
        Id = "FES_ZELLER_BLOCKER";
        Name = "庆典型蔡勒";
        Description = "自身/2回合/魔法攻击提高7500";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 7500;
    }
}

public class SnSethGuard : BaseBuff
{
    public SnSethGuard()
    {
        Id = "SN_SETH_GUARD";
        Name = "夏夜型赛斯";
        Description = "己方/全体/3回合/生命上限提升20000，全防御提升7500";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 7500;
        inStruct.AddMDefense += 7500;
        inStruct.AddHealth += 20000;
    }
}

public class SnSethBlocker : BaseBuff
{
    public SnSethBlocker()
    {
        Id = "SN_SETH_BLOCKER";
        Name = "夏夜型赛斯";
        Description = "自身/3回合/魔法攻击提升25000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 25000;
    }
}

public class SnSethSupport : BaseBuff
{
    public SnSethSupport()
    {
        Id = "SN_SETH_SUPPORT";
        Name = "夏夜型赛斯";
        Description = "自身/3回合/回复量提升7500";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHeal);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHeal += 7500;
    }
}

public class AddMaxHealth10000 : BaseBuff
{
    public AddMaxHealth10000()
    {
        Id = "ADD_MAX_HEALTH_10000";
        Name = "生命提升10000";
        Description = "自身/99回合/生命提升10000";
        Duration = 99;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 99;
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 10000;
    }
}

public class AddPAttack2000 : BaseBuff
{
    public AddPAttack2000()
    {
        Id = "ADD_PATTACK_2000";
        Name = "物理攻击提升2000";
        Description = "自身/99回合/物理攻击提升2000";
        Duration = 99;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 99;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 2000;
    }
}

public class AcidWormMdDown : BaseBuff
{
    public AcidWormMdDown()
    {
        Id = "ACID_WORM_MDDOWN";
        Name = "强酸型蠕虫-减魔法防御";
        Description = "全体/3回合/魔法防御降低3000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense -= 3000;
    }
}

public class Taunt1 : BaseBuff
{
    public Taunt1()
    {
        Id = "TAUNT1";
        Name = "嘲讽1";
        Description = "自身/3回合/嘲讽:1";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.Taunt);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.Taunt += 1;
    }
}

public class HamsterSpa : BaseBuff
{
    public HamsterSpa()
    {
        Id = "HAMSTER_SPA";
        Name = "疾走型地鼠-单体加攻";
        Description = "自身/99回合/物理攻击+2000,可叠加";
        Duration = 99;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 99;
        IsUnique = false;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 2000;
    }
}

public class HamsterSpd : BaseBuff
{
    public HamsterSpd()
    {
        Id = "HAMSTER_SPD";
        Name = "疾走型地鼠-加防";
        Description = "自身/3回合/物理防御+5000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 5000;
    }
}

public class B53 : BaseBuff
{
    public B53()
    {
        Id = "53";
        Name = "狂想曲";
        Description = "己方/单体/1回合/全攻击提高60000";
        Duration = 1;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 60000;
        inStruct.AddMAttack += 60000;
    }
}

public class B55 : BaseBuff
{
    public B55()
    {
        Id = "55";
        Name = "势不可挡";
        Description = "己方/全体/2回合/全攻击提高7500";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 7500;
        inStruct.AddMAttack += 7500;
    }
}

public class B56 : BaseBuff
{
    public B56()
    {
        Id = "56";
        Name = "败者食尘";
        Description = "自身/2回合/回复量提高5000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHeal);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHeal += 5000;
    }
}

public class B57 : BaseBuff
{
    public B57()
    {
        Id = "57";
        Name = "英雄";
        Description = "自身/1回合/魔法攻击提高20000";
        Duration = 1;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 20000;
    }
}

public class B58 : BaseBuff
{
    public B58()
    {
        Id = "58";
        Name = "太空奇谈";
        Description = "敌方/全体/2回合/全攻击降低3000,2连携以上、受到的光属性伤害+25%";
        Duration = 1;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
        Tags.Add(BuffTag.Attacked);
        Tags.Add(BuffTag.BeLightUp);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 3000;
        inStruct.AddMAttack -= 3000;
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        if (data is not Damage damage || tag != BuffTag.Attacked || (damage.Attribute & (int)Attribute.LIGHT) == 0) return Task.CompletedTask;
        if (!damage.Modifiers.TryAdd(DamageModifier.DamageScale, 1.25f))
        {
            damage.Modifiers[DamageModifier.DamageScale] += 0.25f;
        }

        return Task.CompletedTask;
    }
}

public class B59 : BaseBuff
{
    public B59()
    {
        Id = "59";
        Name = "星人";
        Description = "敌方/单体/3回合/魔法防御降低25000,魔法攻击降低5000";
        Duration = 3;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 5000;
        inStruct.AddMDefense -= 25000;
    }
}

public class B61 : BaseBuff
{
    public B61()
    {
        Id = "61";
        Name = "愿你于此";
        Description = "己方/全体/3回合/全防御提高3000，抽卡+1";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddMDefense += 3000;
        inStruct.AddDraw += 1;
    }
}

public class B62 : BaseBuff
{
    public B62()
    {
        Id = "62";
        Name = "月之暗面";
        Description = "己方/全体/2回合/最大生命值提高30000,物理攻击提高10000+20%当前生命上限";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 30000;
        inStruct.AddPAttack += 10000 + (int)(Owner.MaxHealth * 0.2);
    }
}

public class B63 : BaseBuff
{
    public B63()
    {
        Id = "63";
        Name = "迷墙";
        Description = "自身/2回合/嘲讽:2，生命上限提高15000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.Taunt);
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 15000;
        inStruct.Taunt += 2;
    }
}

public class B64 : BaseBuff
{
    public B64()
    {
        Id = "64";
        Name = "原子之心";
        Description = "己方/全体/2回合/魔法防御提高5000,抽卡+1";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 5000;
        inStruct.AddDraw += 1;
    }
}

public class B66 : BaseBuff
{
    public B66()
    {
        Id = "66";
        Name = "无星";
        Description = "自身/1回合/物理攻击提高20000";
        Duration = 1;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 20000;
    }
}

public class B67 : BaseBuff
{
    public B67()
    {
        Id = "67";
        Name = "深红国王的宫廷";
        Description = "自身/2回合/物理攻击提高15000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 15000;
    }
}

public class SlimeEarthGuard : BaseBuff
{
    public SlimeEarthGuard()
    {
        Id = "SLIME_EARTH_GUARD";
        Name = "万化型史莱姆";
        Description = "己方/全体/2回合/魔法防御提高5000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 5000;
    }
}

public class SlimeEarthBlocker : BaseBuff
{
    public SlimeEarthBlocker()
    {
        Id = "SLIME_EARTH_BLOCKER";
        Name = "万化型史莱姆";
        Description = "敌方/全体/2回合/全攻击降低3000,2连携以上、降低量变为4000";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= SpecialFlag ? 4000 : 3000;
        inStruct.AddMDefense -= SpecialFlag ? 4000 : 3000;
    }
}

public class SwanGuard : BaseBuff
{
    public SwanGuard()
    {
        Id = "SWAN_GUARD";
        Name = "强袭型鹄";
        Description = "己方/全体/2回合/物理防御提高1000,抽卡+2";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 1000;
        inStruct.AddDraw += 2;
    }
}

public class SwanSupport : BaseBuff
{
    public SwanSupport()
    {
        Id = "SWAN_SUPPORT";
        Name = "强袭型鹄";
        Description = "自身/3回合/回复量提高5000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHeal);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHeal += 5000;
    }
}

public class ChaluxSkillBuff : BaseBuff
{
    public ChaluxSkillBuff()
    {
        Id = "CHALUX_SKILL_BUFF";
        Name = "克鲁克斯技能";
        Description = "自身/2回合/物理攻击提高25000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 25000;
    }
}

public class MerlinSkillBuff : BaseBuff
{
    public MerlinSkillBuff()
    {
        Id = "MERLIN_SKILL_BUFF";
        Name = "梅林技能效果";
        Description = "己方/全体/2回合/全攻击提升10000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 10000;
        inStruct.AddMAttack += 10000;
    }
}

public class ForgeSkillBuff : BaseBuff
{
    public ForgeSkillBuff()
    {
        Id = "FORGE_SKILL_BUFF";
        Name = "福奇技能效果";
        Description = "己方/全体/2回合/全防御提高20%伤害量";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += TempValue;
        inStruct.AddMDefense += TempValue;
    }
}

public class CollinSkillBuff : BaseBuff
{
    public CollinSkillBuff()
    {
        Id = "COLLIN_SKILL_BUFF";
        Name = "科林技能效果";
        Description = "己方/全体/1回合/生命上限提高50000";
        Duration = 1;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 50000;
    }
}

public class SethSkillBuff : BaseBuff
{
    public SethSkillBuff()
    {
        Id = "SETH_SKILL_BUFF";
        Name = "塞斯技能效果";
        Description = "己方/全体/1回合/物理攻击提高25000";
        Duration = 1;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 25000;
    }
}

public class RainsSkillBuff : BaseBuff
{
    public RainsSkillBuff()
    {
        Id = "RAINS_SKILL_BUFF";
        Name = "雷恩斯技能效果";
        Description = "敌方/全体/1回合/全攻击降低10000";
        Duration = 1;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 10000;
        inStruct.AddMAttack -= 10000;
    }
}

public class CarterSkillDebuff : BaseBuff
{
    public CarterSkillDebuff()
    {
        Id = "CARTER_SKILL_BUFF";
        Name = "卡特技能效果";
        Description = "自身/3回合/嘲讽:5,生命上限提高100000";
        Duration = 3;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
        Tags.Add(BuffTag.Taunt);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 100000;
        inStruct.Taunt += 5;
    }
}

public class ZellerSkillBuff : BaseBuff
{
    public ZellerSkillBuff()
    {
        Id = "ZELLER_SKILL_BUFF";
        Name = "蔡勒技能效果";
        Description = "自身/1回合/物理攻击提高5000";
        Duration = 1;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 5000;
    }
}

public class SantosSkillBuff : BaseBuff
{
    public SantosSkillBuff()
    {
        Id = "SANTOS_SKILL_BUFF";
        Name = "桑托斯技能效果";
        Description = "敌全体/1回合/全攻击降低7500.光属性的场合，受到的暗属性伤害的最终伤害增加30%";
        Duration = 1;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 7500;
        inStruct.AddMAttack -= 7500;
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        if (tag != BuffTag.Attacked || data is not Damage damage || (Owner.Attribute & (int)Attribute.LIGHT) == 0)
            return Task.CompletedTask;
        if (!damage.Modifiers.TryAdd(DamageModifier.DamageScale, 1.3f))
        {
            damage.Modifiers[DamageModifier.DamageScale] += 0.3f;
        }

        return Task.CompletedTask;
    }
}

public class TyphoonSkillBuff : BaseBuff
{
    public TyphoonSkillBuff()
    {
        Id = "TYPHOON_SKILL_BUFF";
        Name = "泰夫技能效果";
        Description = "己方全体/2回合/全攻击提高10000";
        Type = BuffType.BUFF;
        Duration = 2;
        StackLimit = 1;
        StackNum = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 10000;
        inStruct.AddMAttack += 10000;
    }
}

public class LizEarthAttacker : BaseBuff
{
    public LizEarthAttacker()
    {
        Id = "LIZ_EARTH_ATTACKER";
        Name = "强袭型地蜥";
        Description = "自身/2回合/全攻击提高4000点，自身2张以上、提高量增加50%";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += SpecialFlag ? 6000 : 4000;
        inStruct.AddMAttack += SpecialFlag ? 6000 : 4000;
    }
}

public class LizEarthGuard : BaseBuff
{
    public LizEarthGuard()
    {
        Id = "LIZ_EARTH_GUARD";
        Name = "强袭型地蜥";
        Description = "己方/单体/2回合/赋予状态-攻击时自身参与攻击，造成100%物理地属性攻击的伤害";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        IsUnique = false;
        Tags.Add(BuffTag.ExtraAttack);
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        if (tag != BuffTag.Attack || data is not Damage { IsFinal: false } damage ||
            Causer is not IBattlePawn { IsDead : false }) return Task.CompletedTask;
        var d = new Damage()
        {
            Value = Causer.PAttack,
            Role = Causer.Role,
            Attribute = (int)Attribute.EARTH,
            Tags = [Tag.EARTH, Tag.PATTACK],
            Target = damage.Target,
            User = Causer,
            Times = 1,
            IsFinal = true,
        };
        return Mod?.DoDamage(d);
    }
}

public class SciSantosAe : BaseBuff
{
    public SciSantosAe()
    {
        Id = "SCI_SANTOS_A_E";
        Name = "学术型桑托斯";
        Description = "敌方/单体/2回合/魔法伤害降低5000";
        Duration = 2;
        Type = BuffType.DEBUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 5000;
    }
}

public class SciSantosAt : BaseBuff
{
    public SciSantosAt()
    {
        Id = "SCI_SANTOS_A_T";
        Name = "学术型桑托斯";
        Description = "自身/2回合/魔法攻击提高5000";
        Duration = 2;
        Type = BuffType.BUFF;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 5000;
    }
}

public class SciSantosG : BaseBuff
{
    public SciSantosG()
    {
        Id = "SCI_SANTOS_G";
        Name = "学术型桑托斯";
        Description = "己方/全体/2回合/魔法防御提高5000,抽卡+1";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 5000;
        inStruct.AddDraw += 1;
    }
}

public class SsRainsG : BaseBuff
{
    public SsRainsG()
    {
        Id = "SS_RAINS_G";
        Name = "泳装型雷恩斯";
        Description = "己方/全体/2回合/抽卡+2";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddDraw += 2;
    }
}

public class FortisCarterG : BaseBuff
{
    public FortisCarterG()
    {
        Id = "FORTIS_CARTER_G";
        Name = "强音型卡特";
        Description = "己方/全体/2回合/全防御提高5000";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 5000;
        inStruct.AddMDefense += 5000;
    }
}

public class FortisCarterB : BaseBuff
{
    public FortisCarterB()
    {
        Id = "FORTIS_CARTER_B";
        Name = "强音型卡特";
        Description = "自身/3回合/魔法攻击提高5000";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 5000;
    }
}

public class KnightCollinG : BaseBuff
{
    public KnightCollinG()
    {
        Id = "KNIGHT_COLLIN_G";
        Name = "骑士型科林";
        Description = "己方/全体/2回合/魔法防御提高3000,自身防御2张以上，变为全防御";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 3000;
        if (SpecialFlag) inStruct.AddPDefense += 3000;
    }
}

public class KnightCollinB : BaseBuff
{
    public KnightCollinB()
    {
        Id = "KNIGHT_COLLIN_B";
        Name = "骑士型科林";
        Description = "敌方/单体/2回合/全伤害降低2000,3连携以上、目标改为敌全体";
        Type = BuffType.DEBUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 2000;
        inStruct.AddMAttack -= 2000;
    }
}

public class FortisZellerG : BaseBuff
{
    public FortisZellerG()
    {
        Id = "FORTIS_ZELLER_G";
        Name = "强音型蔡勒";
        Description = "己方/全体/3回合/全防御提高3000，抽卡+1";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddMDefense += 3000;
        inStruct.AddDraw += 1;
    }
}

public class FortisZellerS : BaseBuff
{
    public FortisZellerS()
    {
        Id = "FORTIS_ZELLER_S";
        Name = "强音型蔡勒";
        Description = "己方全体1回合全攻击提高5000";
        Type = BuffType.BUFF;
        Duration = 1;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 5000;
        inStruct.AddMAttack += 5000;
    }
}

public class KnightForgeG : BaseBuff
{
    public KnightForgeG()
    {
        Id = "KNIGHT_FORGE_G";
        Name = "骑士型福奇";
        Description = "敌方/单体/物理/7500点地属性伤害,己方全体2回合全防御提高伤害量10%";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += TempValue;
        inStruct.AddMDefense += TempValue;
    }
}

public class KnightForgeB : BaseBuff
{
    public KnightForgeB()
    {
        Id = "KNIGHT_FORGE_B";
        Name = "骑士型福奇";
        Description = "敌方/单体/1回合/全攻击降低1000。消耗75点能量，妨害量改为99999999";
        Type = BuffType.DEBUFF;
        Duration = 1;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= SpecialFlag ? 99999999 : 1000;
        inStruct.AddMAttack -= SpecialFlag ? 99999999 : 1000;
    }
}

public class FlowerMerlinG : BaseBuff
{
    public FlowerMerlinG()
    {
        Id = "FLOWER_MERLIN_G";
        Name = "花落型梅林";
        Description = "自身/2回合/嘲讽:2，生命上限提高15000";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
        Tags.Add(BuffTag.Taunt);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 15000;
        inStruct.Taunt += 2;
    }
}

public class FlowerMerlinB : BaseBuff
{
    public FlowerMerlinB()
    {
        Id = "FLOWER_MERLIN_B";
        Name = "花落型梅林";
        Description = "敌方/单体/2回合/魔法伤害降低5000";
        Type = BuffType.DEBUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 5000;
    }
}

public class FlowerMerlinS : BaseBuff
{
    public FlowerMerlinS()
    {
        Id = "FLOWER_MERLIN_S";
        Name = "花落型梅林";
        Description = "自身/3回合/回复量提高7500";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHeal);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHeal += 7500;
    }
}

public class LizEarthCounter : BaseBuff
{
    private int _count;

    public LizEarthCounter()
    {
        Id = "LIZ_EARTH_COUNTER";
        Name = "强袭型地蜥-反击";
        Description = "本回合受到魔法伤害的场合，全体攻击，造成5000*受到的魔法伤害的攻击的次数的地属性物理伤害";
        Type = BuffType.BUFF;
        Duration = -1;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.CounterAttack);
    }

    public override void CountDuration()
    {
        // 重写让buff永久生效
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        switch (tag)
        {
            case BuffTag.TurnStart:
                _count = 0;
                break;
            case BuffTag.AfterEnemyAction:
                Damage damage = new()
                {
                    Value = 5000 * _count,
                    Attribute = (int)Attribute.EARTH,
                    Role = Role.GUARD,
                    Times = 1,
                    User = Owner,
                    Target = Mod?.Teammates.ToList<BasePawn>(),
                    IsFinal = true,
                };
                return Mod?.DoDamage(damage);
            case BuffTag.Attacked:
                if (data is Damage d && d.Tags.Contains(Tag.MATTACK))
                {
                    _count += d.Times;
                }

                break;
        }

        return Task.CompletedTask;
    }
}

public class ValentineSsG : BaseBuff
{
    public ValentineSsG()
    {
        Id = "VALENTINE_SS_G";
        Name = "心挚永爱 星&赛斯";
        Description = "己方/全体/2回合/魔法防御提高3000,2连携以上、抽卡+1,3连携以上、变为全防御";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense += 3000;
        inStruct.AddDraw += TempValue >= 2 ? 1 : 0;
        inStruct.AddPDefense += TempValue >= 3 ? 3000 : 0;
    }
}

public class ValentineSsB : BaseBuff
{
    public ValentineSsB()
    {
        Id = "VALENTINE_SS_B";
        Name = "心挚永爱 星&赛斯";
        Description = "自身/2回合/魔法攻击提高6000，2连携以上、每1连携提高100%威力";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack += 6000 * TempValue;
    }
}

public class MetalZcG : BaseBuff
{
    public MetalZcG()
    {
        Id = "METAL_ZC_G";
        Name = "重金属 蔡勒&卡特";
        Description = "自身/3回合/嘲讽:1,全防御提高4000点";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.Taunt);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 4000;
        inStruct.Taunt += 1;
        inStruct.AddMDefense += 4000;
    }
}

public class MetalZcS : BaseBuff
{
    public MetalZcS()
    {
        Id = "METAL_ZC_S";
        Name = "重金属 蔡勒&卡特";
        Description = "2回合生命上限提高7500";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 7500;
    }
}

public class SciRainsG : BaseBuff
{
    public SciRainsG()
    {
        Id = "SCI_RAINS_G";
        Name = "学术型雷恩斯";
        Description = "己方/单体/2回合/抽卡+2，生命上限提高5000点";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddDraw);
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddDraw += 2;
        inStruct.AddHealth += 5000;
    }
}

public class SciRainsB : BaseBuff
{
    public SciRainsB()
    {
        Id = "SCI_RAINS_B";
        Name = "学术型雷恩斯";
        Description = "敌方/全体/2回合/魔法攻击降低1000点,自身猫科、降低值改为3000";
        Type = BuffType.DEBUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= SpecialFlag ? 3000 : 1000;
    }
}

public class SciRainsS : BaseBuff
{
    public SciRainsS()
    {
        Id = "SCI_RAINS_S";
        Name = "学术型雷恩斯";
        Description = "3回合回合开始时回复1点生命";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.Heal);
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        HealStruct heal = new()
        {
            Value = (int)TempValue,
            Role = Role.GUARD,
            Attribute = (int)Attribute.NONE,
            Target = [Owner],
            User = Owner,
            ChainNum = 1,
        };
        return Mod?.DoHeal(heal);
    }
}

public class BalladTyphoonA : BaseBuff
{
    public BalladTyphoonA()
    {
        Id = "BALLAD_TYPHOON_A";
        Name = "歌谣型泰夫";
        Description = "自身/2回合/物理攻击提高3000+1%当前生命，自身2张以上、改为3%，自身3张以上、改为5%";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 3000 + TempValue;
    }
}

public class BalladTyphoonB : BaseBuff
{
    public BalladTyphoonB()
    {
        Id = "BALLAD_TYPHOON_B";
        Name = "歌谣型泰夫";
        Description = "敌方/单体/2回合/魔法防御降低5000+10%当前生命值";
        Type = BuffType.DEBUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMDefense -= 5000 + TempValue;
    }
}

public class BalladTyphoonG : BaseBuff
{
    public BalladTyphoonG()
    {
        Id = "BALLAD_TYPHOON_G";
        Name = "歌谣型泰夫";
        Description = "自身/3回合/嘲讽：4";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.Taunt);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.Taunt += 4;
    }
}

public class BalladTyphoonS : BaseBuff
{
    public BalladTyphoonS()
    {
        Id = "BALLAD_TYPHOON_S";
        Name = "歌谣型泰夫";
        Description = "己方/单体/2回合/全攻击提高1000点";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMDefense);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += 1000;
        inStruct.AddMDefense += 1000;
    }
}

public class OccultismTripleG : BaseBuff
{
    public OccultismTripleG()
    {
        Id = "OCCULTISM_TRIPLE_G";
        Name = "神秘学 E&S&R";
        Description = "己方/全体/2回合/全防御提高3000，队伍Unknown|鼠兔|猫科2以上、伤害减免+20%";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.Reduction);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddMDefense += 3000;
        inStruct.Reduction -= SpecialFlag ? 0.2f : 0f;
    }
}

public class OccultismTripleS : BaseBuff
{
    public OccultismTripleS()
    {
        Id = "OCCULTISM_TRIPLE_S";
        Name = "神秘学 E&S&R";
        Description = "己方/单体/3回合/全攻击提高7500点，队伍Unknown|鼠兔|猫科2以上、对象变更为全体，3连携以上、改为15000点";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += SpecialFlag ? 15000 : 7500;
        inStruct.AddMAttack += SpecialFlag ? 15000 : 7500;
    }
}

public class ChivalryFcG : BaseBuff
{
    public ChivalryFcG()
    {
        Id = "CHIVALRY_FC_G";
        Name = "骑士道 福奇&科林";
        Description = "己方/全体/3回合/全防御提高12500点,抽卡+2";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 12500;
        inStruct.AddMDefense += 12500;
        inStruct.AddDraw += 2;
    }
}

public class ChivalryFcB : BaseBuff
{
    public ChivalryFcB()
    {
        Id = "CHIVALRY_FC_B";
        Name = "骑士道 福奇&科林";
        Description = "敌方/单体/3回合/全攻击降低30%+30000,受到伤害+100%";
        Type = BuffType.DEBUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.ExtraPAttack);
        Tags.Add(BuffTag.AddMAttack);
        Tags.Add(BuffTag.ExtraMAttack);
        Tags.Add(BuffTag.Reduction);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 30000;
        inStruct.AddMAttack -= 30000;
        inStruct.Reduction += 1f;
        inStruct.ExtraPAttack -= 0.3f;
        inStruct.ExtraMAttack -= 0.3f;
    }
}

public class ChivalryFcS : BaseBuff
{
    public ChivalryFcS()
    {
        Id = "CHIVALRY_FC_S";
        Name = "骑士道 福奇&科林";
        Description = "己方/全体/3回合/生命上限提高20000";
        Type = BuffType.BUFF;
        Duration = 3;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddHealth);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddHealth += 20000;
    }
}

public class WaiterCollinG : BaseBuff
{
    public WaiterCollinG()
    {
        Id = "WAITER_COLLIN_G";
        Name = "服务员 科林";
        Description = "己方/全体/2回合/全防御提高3000,抽卡+1";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += 3000;
        inStruct.AddMDefense += 3000;
        inStruct.AddDraw += 1;
    }
}

public class WaiterCollinB : BaseBuff
{
    public WaiterCollinB()
    {
        Id = "WAITER_COLLIN_B";
        Name = "服务员 科林";
        Description = "敌方/全体/2回合/全攻击降低3000";
        Type = BuffType.DEBUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack -= 3000;
        inStruct.AddMAttack -= 3000;
    }
}

public class JamRzA : BaseBuff
{
    public JamRzA()
    {
        Id = "JAM_RZ_A";
        Name = "即兴演奏 雷恩斯&蔡勒";
        Description = "自身/2回合/全攻击提高10000，自身水|火2张以上、变更为20000";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPAttack);
        Tags.Add(BuffTag.AddMAttack);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPAttack += SpecialFlag ? 20000 : 10000;
        inStruct.AddMAttack += SpecialFlag ? 20000 : 10000;
    }
}

public class JamRzG : BaseBuff
{
    public JamRzG()
    {
        Id = "JAM_RZ_B";
        Name = "即兴演奏 雷恩斯&蔡勒";
        Description = "己方/全体/2回合/全防御提高5000，抽卡+1,3连携以上、威力+100%";
        Type = BuffType.BUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddPDefense);
        Tags.Add(BuffTag.AddMDefense);
        Tags.Add(BuffTag.AddDraw);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddPDefense += SpecialFlag ? 10000 : 5000;
        inStruct.AddMDefense += SpecialFlag ? 10000 : 5000;
        inStruct.AddDraw += SpecialFlag ? 2 : 1;
    }
}

public class JamRzB : BaseBuff
{
    public JamRzB()
    {
        Id = "JAM_RZ_S";
        Name = "即兴演奏 雷恩斯&蔡勒";
        Description = "敌方/全体/2回合/魔法攻击降低5000点，受到水|火伤害+50%";
        Type = BuffType.DEBUFF;
        Duration = 2;
        StackNum = 1;
        StackLimit = 1;
        Tags.Add(BuffTag.AddMAttack);
        Tags.Add(BuffTag.Reduction);
    }

    public override void RefreshProps(ref TempPropStruct inStruct)
    {
        inStruct.AddMAttack -= 5000;
    }

    public override Task ApplyBuff(ref object data, BuffTag tag = BuffTag.None)
    {
        if (tag == BuffTag.BeforeAttacked && data is Damage damage)
        {
            if ((damage.Attribute | (int)Attribute.WATER) > 0 || (damage.Attribute | (int)Attribute.FIRE) > 0)
            {
                if (!damage.Modifiers.TryAdd(DamageModifier.DamageScale, 1.5f))
                {
                    damage.Modifiers[DamageModifier.DamageScale] += 0.5f;
                }
            }
        }

        return Task.CompletedTask;
    }
}